/*
 * @Description: 
 * @Author: 赵大壮
 * @Date: 2021-11-25 13:05:57
 * @LastEditTime: 2022-12-05 12:36:51
 * @LastEditors: 赵大壮
 */
import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router';
import HomeLayout from "../layout/HomeLayout.vue";

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  /**
   * 登录
   */
  {
    path: "/login", name: "login", meta: { title: "登录" },
    component: () => import("@/views/登录/view/Index.vue"),
  },
  /**
   * 测评管理
   */
  {
    path: '/',
    component: HomeLayout,
    redirect: "/assess",
    children: [
      {
        path: "/assess", name: "assess", meta: { title: "测评列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/测评管理/view/测评列表/Index.vue"),
      },
      {
        path: "/assess/rule", name: "rule", meta: { title: "规则列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/测评管理/view/规则列表/Index.vue"),
      },
      {
        path: "/assess/question", name: "question", meta: { title: "问题列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/测评管理/view/问题列表/Index.vue"),
      },
    ],
  },
  /**
   * 公司管理
   */
  {
    path: '/company',
    component: HomeLayout,
    redirect: "/company/info",
    children: [
      {
        path: "/company/info", name: "info", meta: { title: "公司管理", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/公司管理/view/Index.vue"),
      },
      {
        path: "/company/staff", name: "staff", meta: { title: "员工管理", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/员工管理/view/Index.vue"),
      },
      {
        path: "/company/staffBin", name: "staffBin", meta: { title: "员工回收站", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/员工管理/view/回收站/Bin.vue"),
      }
    ],
  },
  /**
   * 报告管理
   */
  {
    path: '/report',
    component: HomeLayout,
    redirect: "/report/list",
    children: [
      {
        path: "/report/list", name: "reportList", meta: { title: "量表测评结果", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/报告管理/view/Index.vue"),
      },
      {
        path: "/report/assessinfo", name: "assessinfo", meta: { title: "量表测评记录", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/报告管理/view/量表测评记录/Index.vue"),
      }
    ],
  },
  /**
   * 文章管理
   */
  {
    path: '/article',
    component: HomeLayout,
    redirect: "/article/type",
    children: [
      {
        path: "/article/type", name: "articleType", meta: { title: "文章类别", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/文章管理/view/文章类别/Index.vue"),
      },
      {
        path: "/article/list", name: "articleList", meta: { title: "文章列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/文章管理/view/文章列表/Index.vue"),
      },
      {
        path: "/article/info", name: "articleInfo", meta: { title: "文章详情", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/文章管理/view/文章详情/Index.vue"),
      }
    ],
  },
  /**
   * 视频管理
   */
  {
    path: '/video',
    component: HomeLayout,
    redirect: "/video/list",
    children: [
      {
        path: "/video/list", name: "videoList", meta: { title: "视频列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/视频管理/view/视频列表/Index.vue"),
      },
      {
        path: "/video/type", name: "videoType", meta: { title: "视频类别", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/视频管理/view/视频类别/Index.vue"),
      },
      {
        path: "/video/info", name: "videoInfo", meta: { title: "视频详情", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/视频管理/view/视频详情/Index.vue"),
      }
    ],
  },
  /**
   * 问卷管理
   */
  {
    path: '/investigate',
    component: HomeLayout,
    redirect: "/investigate/list",
    children: [
      {
        path: "/investigate/list", name: "investigateList", meta: { title: "调查问卷列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/问卷管理/view/调查问卷列表/Index.vue"),
      },
      {
        path: "/investigate/info", name: "investigateInfo", meta: { title: "调查问卷详情", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/问卷管理/view/调查问卷详情/Index.vue"),
      },
      {
        path: "/base/template", name: "baseTemplate", meta: { title: "基本信息模板", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/问卷管理/view/基本信息模板管理/Index.vue"),
      },
      {
        path: "/base/list", name: "baseList", meta: { title: "基本信息列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/问卷管理/view/基本信息管理/Index.vue"),
      },
      {
        path: "/question/template", name: "questionTemplate", meta: { title: "问卷问题模板", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/问卷管理/view/问卷问题模板管理/Index.vue"),
      },
      {
        path: "/question/list", name: "questionList", meta: { title: "问卷问题列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/问卷管理/view/问卷问题管理/Index.vue"),
      },
      {
        path: "/investigate/req", name: "investigateReq", meta: { title: "调查问卷结果", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/问卷管理/view/调查问卷结果/Index.vue"),
      },
      {
        path: "/investigate/reqList", name: "investigateReqList", meta: { title: "综合问卷记录", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/问卷管理/view/综合问卷记录/Index.vue"),
      }
    ],
  },
  /**
   * banner管理
   */
  {
    path: '/banner',
    component: HomeLayout,
    redirect: "/banner/list",
    children: [
      {
        path: "/banner/list", name: "bannerList", meta: { title: "banner管理", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/banner管理/view/企业版/Index.vue"),
      },
      {
        path: "/banner/storelist", name: "bannerStoreList", meta: { title: "商城banner管理", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/banner管理/view/个人版/Index.vue"),
      }
    ],
  },
  /**
   * 咨询管理
   */
  {
    path: '/export',
    component: HomeLayout,
    redirect: "/export/list",
    children: [
      {
        path: "/export/list", name: "exportList", meta: { title: "咨询师列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/咨询管理/view/咨询师列表/Index.vue"),
      },
      {
        path: "/export/info", name: "exportInfo", meta: { title: "咨询师详情", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/咨询管理/view/咨询师详情/Index.vue"),
      },
      {
        path: "/export/service", name: "exportService", meta: { title: "咨询列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/咨询管理/view/咨询列表/Index.vue"),
      }
    ],
  },
  /**
   * 意见反馈
   */
  {
    path: '/feedback',
    component: HomeLayout,
    redirect: "/feedback/list",
    children: [
      {
        path: "/feedback/list", name: "feedbackList", meta: { title: "意见反馈", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/意见反馈/view/Index.vue"),
      }
    ],
  },
  /**
   * 商品管理
   */
  {
    path: '/goods',
    component: HomeLayout,
    redirect: "/goods/list",
    children: [
      {
        path: "/goods/list", name: "goodsList", meta: { title: "商品列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/商品管理/view/商品列表/Index.vue"),
      },
      {
        path: "/goods/info", name: "goodsInfo", meta: { title: "商品详情", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/商品管理/view/商品详情/Index.vue"),
      }
    ],
  },
  /**
   * 商城管理
   */
  {
    path: '/store',
    component: HomeLayout,
    redirect: "/store/user",
    children: [
      {
        path: "/store/user", name: "storeUser", meta: { title: "用户管理", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/商城用户管理/view/Index.vue"),
      },
      {
        path: "/store/order", name: "storeOrder", meta: { title: "订单管理", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/订单管理/view/Index.vue"),
      },
      {
        path: "/store/userSubscribe", name: "userSubscribe", meta: { title: "个人预约记录", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/个人预约管理/view/Index.vue"),
      },
      {
        path: "/store/userAssess", name: "userAssess", meta: { title: "个人测评记录", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/个人测评管理/view/Index.vue"),
      },
      {
        path: "/store/occupation", name: "occupationDic", meta: { title: "职业字典管理", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/职业管理/view/Index.vue"),
      }
    ],
  },
  /**
   * 优惠券管理
   */
  {
    path: '/coupon',
    component: HomeLayout,
    redirect: "/coupon/batch",
    children: [
      {
        path: "/coupon/batch", name: "batchList", meta: { title: "批次列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/优惠券管理/view/Index.vue"),
      }
    ],
  },
  /**
   * 用户管理
   */
  {
    path: '/user',
    component: HomeLayout,
    redirect: "/user/role",
    children: [
      {
        path: "/user/role", name: "roleList", meta: { title: "角色列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/用户管理/view/角色列表/Index.vue"),
      },
      {
        path: "/user/admin", name: "adminList", meta: { title: "管理员列表", bool_widthFull: '1', keepAlive: true },
        component: () => import("@/views/用户管理/view/用户列表/Index.vue"),
      }
    ],
  },
];

export default new VueRouter({
  routes,
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
});

